﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Add_album.aspx.cs" Inherits="Admin_Add_album" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style9
        {
            width: 17px;
        }
        .style10
        {
            width: 267px;
            text-align: right;
        }
        .style12
        {
            font-weight: bold;
            color: #3399FF;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td colspan="3" style="text-align: center">
                <asp:Label ID="Label1" runat="server" 
                    style="font-size: xx-large; font-weight: 700; color: #CC9900;" 
                    Text="Add Album"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="3" style="text-align: center">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                <asp:Label ID="Label2" runat="server" CssClass="style12" Text="Album name"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtAlbumname" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                <asp:Label ID="txtDescription" runat="server" CssClass="style12" 
                    Text="Description"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10" valign="top">
                <asp:Label ID="cldDate" runat="server" CssClass="style12" Text="Created date"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:Calendar ID="cldCreatdate" runat="server"></asp:Calendar>
            </td>
        </tr>
        <tr>
            <td class="style10">
                <asp:Label ID="ddlCreatID" runat="server" CssClass="style12" Text="Created ID"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:DropDownList ID="DropDownList1" runat="server">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem Value="1">Administartor</asp:ListItem>
                    <asp:ListItem Value="2">Staff</asp:ListItem>
                    <asp:ListItem Value="4">Upload</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style10">
                <asp:Label ID="lblMsg" runat="server" style="font-size: medium; color: #FF0000"></asp:Label>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblAlbum] WHERE [albumId] = @albumId" 
                    InsertCommand="INSERT INTO [tblAlbum] ([albumName], [albumDescription], [createdDate], [creatorId]) VALUES (@albumName, @albumDescription, @createdDate, @creatorId)" 
                    SelectCommand="SELECT * FROM [tblAlbum]" 
                    UpdateCommand="UPDATE [tblAlbum] SET [albumName] = @albumName, [albumDescription] = @albumDescription, [createdDate] = @createdDate, [creatorId] = @creatorId WHERE [albumName] = @albumName">
                    <DeleteParameters>
                        <asp:Parameter Name="albumId" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:ControlParameter ControlID="txtAlbum" Name="albumName" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="txtDescription" Name="albumDescription" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="cldDate" Name="createdDate" 
                            PropertyName="SelectedDate" Type="DateTime" />
                        <asp:ControlParameter ControlID="ddlID" Name="creatorId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtAlbumname" Name="albumName" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TextBox2" Name="albumDescription" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="cldCreatdate" Name="createdDate" 
                            PropertyName="SelectedDate" Type="DateTime" />
                        <asp:ControlParameter ControlID="DropDownList1" Name="creatorId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Add" />
            </td>
        </tr>
    </table>
</asp:Content>

